package com.github.edu.repair.manager.controller;

import com.github.edu.repair.api.server.FwflManagerRestServerApi;
import com.github.edu.repair.manager.service.impl.FwflServerServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by IntelliJ IDEA.
 * user:wangj
 * date:2018/8/20
 * Time: 22:12
 */
@RestController
public class FwflManagerRestController implements FwflManagerRestServerApi {

    @Autowired
    private FwflServerServiceImpl service;

    @Override
    public String getEntity(Integer id) {
        return service.getEntity(id);
    }

    @Override
    public String saveOrUpdate(@RequestBody String jsonEntity) {
        return service.saveOrUpdate(jsonEntity);
    }

    @Override
    public String getAllByPager(String title, Integer current, Integer rows, String order, String fileId) {
        return service.getAllGetEntity(title,current,rows,order,fileId);
    }

    @Override
    public String getALLByPager(@RequestBody String jsonEntity) {
        return service.getALLPostByPager(jsonEntity);
    }

    @Override
    public String getAllEntity(String title, String order, String fileId) {
        return service.getAllEntity(title,order,fileId);
    }

    @Override
    public String deleteAll(String ids) {
        return service.delete(ids);
    }

    @Override
    public String getAll(Integer id) {
        return service.getAllByFwdl(id);
    }
}
